#include <gtk/gtk.h>
#include <stdlib.h>
#include "img_table.h"
#include "scroll_pane.h"

//обработчик закрытия окна
void delete_event(GtkObject *object) {
    gtk_main_quit();
}

int main(int argc, char *argv[]) {

    GtkWidget *window;
    GtkWidget *table;

    gtk_init(&argc, &argv);
    
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_signal_connect_object(GTK_OBJECT(window),
            "delete_event",
            GTK_SIGNAL_FUNC(delete_event),
            NULL);
    gtk_widget_show(window);

    table = img_preview_table_new_from_files(argv + 1);
    gtk_widget_show(table);

    gtk_container_add(GTK_CONTAINER(window), wrap_with_scroll_pane(table));

    gtk_main();

    return 0;
}

